<?php

namespace app\validate;

use think\Validate;

class WorkbenchValidate extends Validate
{

    /**
     * sceneStepCategoryInprogressEpisodeList
     * @return WorkbenchValidate
     */
    public function sceneStepCategoryInprogressEpisodeList(): WorkbenchValidate
    {
        return $this->append('project_id', 'require')
            ->append('step_category_id_list', 'require')
            ->append('current_show_name', 'require');
    }

    /**
     * @return WorkbenchValidate
     */
    public function sceneStepCategorySealEpisodeList(): WorkbenchValidate
    {
        return $this->append('project_id', 'require')
            ->append('step_category_id_list', 'require')
            ->append('current_show_name', 'require');
    }

    /**
     * EpisodeSealShowList 剧集封板播出情况列表
     * @return WorkbenchValidate
     */
    public function sceneEpisodeSealShowList(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'start_time' => 'integer',
            'end_time' => 'integer'
        ]);
    }

    /**
     * GroupPlanDoneCount 部门完成情况
     * @return WorkbenchValidate
     */
    public function sceneGroupPlanDoneCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * GroupDeliveryCount 部门交付情况
     * @return WorkbenchValidate
     */
    public function sceneGroupDeliveryCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * GroupAbnormalAddCount 部门异常任务情况
     * @return WorkbenchValidate
     */
    public function sceneGroupAbnormalAddCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * GroupAbnormalWorkOrderCount 未处理工单异常查询
     * @return WorkbenchValidate
     */
    public function sceneGroupAbnormalWorkOrderCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * GroupAbnormalDelayTaskCount 延期任务数
     * @return WorkbenchValidate
     */
    public function sceneGroupAbnormalDelayTaskCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * GroupUpstreamDeliveryCount 部门完成交付情况
     * @return WorkbenchValidate
     */
    public function sceneGroupUpstreamDeliveryCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'todo_step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
            'today' => 'integer',
        ]);
    }

    /**
     * TodayAbnormalTaskCount 今日异常任务统计
     * @return WorkbenchValidate
     */
    public function sceneTodayAbnormalTaskCount(): WorkbenchValidate
    {
        return $this->append([
            'project_id' => 'require|integer',
            'department_id' => 'integer',
//            'step_category_id_list' => 'array',
            'start_time' => 'integer',
            'end_time' => 'integer',
        ]);
    }

    // WorkbenchDelayOrderInfo 验证条件定义
    public function sceneWorkbenchDelayOrderInfo(): WorkbenchValidate
    {
        return $this->append('project_id', 'require|integer')
            ->append('department_id', 'integer')
            ->append('step_category_id_list', 'require|array')
            ->append('start_time', 'require|integer')
            ->append('end_time', 'require|integer');
    }

    // 与我相关任务统计 自定义验证
    public function sceneGetTaskMemberCount(): WorkbenchValidate
    {
        return $this->append('param', 'require|array');
    }

}
